const Index = resolve => require([ './index.vue' ], resolve)
const Role = resolve => require([ './role/role.vue' ], resolve)
const CreateRole = resolve => require([ './role/createRole.vue' ], resolve)
const ViewRole = resolve => require([ './role/viewRole.vue' ], resolve)
const SetResource = resolve => require([ './role/setResource.vue' ], resolve)
const Resource = resolve => require([ './resource/resource.vue' ], resolve)
const Module = resolve => require([ './module/module.vue' ], resolve)
const people = resolve => require([ './people/people.vue' ], resolve)
const infoseting = resolve => require([ './infoseting/infoseting.vue' ], resolve)
const CreateCommunity = resolve => require([ './infoseting/CreateCommunity.vue' ], resolve)
const ViewCommunity = resolve => require([ './infoseting/ViewCommunity.vue' ], resolve)


const router = [
  {
    path: '/system',
    redirect: '/system/role',
    component: Index,
    children: [
      {
        path: 'role',
        component: Role,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '角色设置'}
          ]
        }
      },
      {
        path: 'role/create',
        component: CreateRole,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '角色设置', path: '/system/role'},
            {name: '新增角色'}
          ]
        }
      },
      {
        path: 'role/edit/:id',
        component: CreateRole,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '角色设置', path: '/system/role'},
            {name: '角色编辑'}
          ]
        }
      },
      {
        path: 'role/view/:id',
        component: ViewRole,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '角色设置', path: '/system/role'},
            {name: '角色预览'}
          ]
        }
      },
      {
        path: 'role/resource/:id',
        component: SetResource,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '角色设置', path: '/system/role'},
            {name: '角色资源配置'}
          ]
        }
      },
      {
        path: 'resource',
        component: Resource,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '资源设置'}
          ]
        }
      },
      {
        path: 'module',
        component: Module,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '模块设置'}
          ]
        }
      },
      {
        path: 'user',
        component: people,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '人员设置'}
          ]
        }
      },
      {
        path: 'info',
        component: infoseting,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '信息设置'}
          ]
        }
      },
      {
        path: 'info/community/create',
        name: 'create-community',
        component: CreateCommunity,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '信息设置', path: '/system/info'},
            {name: '场所新增'}
          ]
        }
      },
      {
        path: 'info/community/edit/:id',
        name: 'edit-community',
        component: CreateCommunity,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '信息设置', path: '/system/info'},
            {name: '场所编辑'}
          ]
        }
      },
      {
        path: 'info/community/view/:id',
        name: 'view-community',
        component: ViewCommunity,
        meta: {
          position: [
            {name: '系统设置'},
            {name: '信息设置', path: '/system/info'},
            {name: '场所预览'}
          ]
        }
      }
    ]
  }
]

export default {
  router
}
